package com.song.colud.feignHystrixOrder.controller;

import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.song.colud.feignHystrixOrder.config.feignConfig;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author ZhangGuisong
 * @Date 2021/2/21-11:52
 */
@RestController

public class feignHystrixController {

    @Resource
    private feignConfig feignConfigu;
    @GetMapping("/consumer/testError/{id}")
    public String getError(@PathVariable("id") Integer id){
        String error = feignConfigu.Error(id);
        return error;
    }
    @GetMapping ("/consumer/testOk/{id}")
    public String testOk(@PathVariable ("id") Integer id){
        String ok = feignConfigu.getOk(id);
        return ok;
    }




}
